<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/tiers.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateContactTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:form>
                <h:panelGrid columns="7">
                    <p:selectOneMenu id="titre" value="#{contactController.selected.titre}" title="#{bundle.CreateContactTitle_titre}" >
                        <f:selectItems value="#{titreContactController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <h:outputLabel value="#{bundle.CreateContactLabel_nom}" for="nom" />
                    <p:inputText id="nom" required="true" value="#{contactController.selected.nom}" title="#{bundle.CreateContactTitle_nom}" />
                    <p:message for="nom"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_prenom}" for="prenom" />
                    <p:inputText id="prenom" required="true" value="#{contactController.selected.prenom}" title="#{bundle.CreateContactTitle_prenom}" />
                    <p:message for="prenom"/>
                    <h:outputLabel/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_fonction}" for="fonction" />
                    <p:inputText id="fonction" value="#{contactController.selected.fonction}" title="#{bundle.CreateContactTitle_fonction}" />
                    <p:message for="fonction"/>
                    <h:outputLabel value="#{bundle.CreateContactLabel_adressePostale}" for="adressePostale" />
                    <p:selectOneMenu id="adressePostale" value="#{contactController.selected.adressePostale}" title="#{bundle.CreateContactTitle_adressePostale}" >
                        <f:selectItems value="#{adressePostaleController.itemsAvailableSelectOne}"/>
                    </p:selectOneMenu>
                    <p:message for="adressePostale"/>
                </h:panelGrid>
                <br />
                <p:commandLink ajax="false" action="#{contactController.create}" value="#{bundle.CreateContactSaveLink}" />
                <br />
                <br />
                <p:commandLink ajax="false" action="#{contactController.prepareList}" value="#{bundle.CreateContactShowAllLink}" immediate="true"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
